#include <algorithm>
#include <functional>
#include <numeric>
#include <iostream>
#include <sstream>
#include <fstream>
#include <cmath>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <complex>
#include <set>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <vector>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
const double eps = 1e-11;
const double pi = acos(-1.0);
const double inf = 1e17;
#define swap(a,b) {a^=b;b^=a;a^=b;}
#define two(X) (1<<(X))
#define pii pair <int,int>
#define SZ(x) ((int)x.size())
template<class T> T gcd(const T &a,const T &b) {return (b==0)?a:gcd(b,a%b);}
template<class T> T lcm(const T &a,const T &b) {return a*(b/gcd(a,b));}
template<class To, class From> To castToFrom(From arg) {To ret;std::stringstream ss(""); ss << arg; ss >> ret; return ret; }//castToFrom<int,string>("1234")
vector<string> split(string& str, char sep ) {
	vector< string > ret;
	string::iterator from( str.begin() );
    int i = 0;
    while( true ) {
		string::iterator to = find( from, str.end(), sep );
        if( to == str.end() ) {
            string temp(from,to);
			ret.push_back( temp );
            break;
        } else {
			string temp(from,to);
            ret.push_back( temp );
            from = ++to;
        }
        i++;
    }
	return ret;
}

const double TIME_LIMIT = 60;
const int NUM_OF_PROBLEMS = 2887;


int main(){;
    
    ofstream fout("ga.in");

    string filename = "log_auto|log_blast|log_simp|log_fast|log_best|log_force|log_fastsimp|log_meson|log_metis";
    string rdLine, pName;
    int sz;
    double time;
    vector<string> fNames, line;
    fNames = split(filename, '|');
    sz = SZ(fNames);

    fout << sz << " " << NUM_OF_PROBLEMS << endl;
    fout << TIME_LIMIT << endl;

    for (int i = 0 ; i < sz; i ++){
        ifstream fin(fNames[i].c_str());
        while (getline(fin,rdLine)){
            line = split(rdLine,' ');
            if (line[0] == pName){
                if (line[1] == "SUCCESS:")
                    fout << time << " ";
                else if (line[1] == "FAILURE:")
                    fout << TIME_LIMIT + 1 << " ";
                else{
                    fout << TIME_LIMIT + 1 << " "; 
                    getline(fin,rdLine);
                }        
            }else{
                pName = line[0];
                time = (line[1] == "timeout")?0:(double)atoi(line[2].c_str())/(double)1000.0;
            }
        }
        fout << endl;
    }
    return 0;
}

